package com.example.pcl.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表，存储所有用户信息
 * </p>
 *
 * @author xx
 * @since 2024-12-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("users")
@Schema(name = "Users对象", description = "用户表，存储所有用户信息")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Users implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Integer userId;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "密码（加密存储）")
    @JsonIgnore
    private String password;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "出生日期")
    private LocalDate birthDate;

    @Schema(description = "性别 (0: 男, 1: 女, 2: 其他)")
    private Integer gender;

    @Schema(description = "联系电话")
    private String phone;

    @Schema(description = "头像URL")
    private String avatarUrl;

    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginTime;

    @Schema(description = "账户状态 (0: 正常, 1: 被禁用)")
    private Integer accountStatus;

    @Schema(description = "用户角色 (0: 学生, 1: 心理咨询师)")
    private Integer role;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;


    public static final Integer MAN = 0;
    public static final Integer GIRL = 1;
    public static final Integer OTHER = 2;


    public static final Integer NORMAL = 0;
    public static final Integer DISABLE = 1;


    public static final Integer STUDENT = 0;
    public static final Integer COUNSELOR = 1;


}
